package com.xxwy.springbootwebfluxclient.api;

import com.xxwy.springbootwebfluxclient.document.User;
import com.xxwy.springbootwebfluxclient.serverinfo.ApiServer;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @author xxwy
 */
@ApiServer("http://localhost:8080/user")
public interface IUserApi {

    @GetMapping("/all")
    Flux<User> getAllUser();

    @DeleteMapping("/{id}")
    Mono<Void> delectUserById(
            @PathVariable("id") String id);

    @PostMapping(value = "/")
    Mono<User> createUser(@RequestBody Mono<User> user);

}
